<?php

class AppModel extends Model
{

    var $actsAs = array('Containable', 'Linkable.Linkable');

    protected function compare($value = array(), $options = array(), $rule = array())
    {
        $value = is_array($value) ? current($value) : $value;
        if( is_array($options) )
        {
            $valid = $value == $this->data[$this->alias][$options[0]];
            if( !$valid )
            {
                $this->invalidate(empty($options[1]) ? $options[0] : $options[1], $rule['message']);
            }
        }
        else
        {
            $valid = $value == $options;
        }

        return $valid;
    }

}
